import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;

public class App {
    public static void main(String[] args) {
        //根据配置信息创建Spring上下文对象
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        BeanFactory beanFactory = new XmlBeanFactory( new ClassPathResource("spring-config.xml"));
        //通过上下文对象获取到bean对象
        Student student = (Student) context.getBean("student");
        /*Student student1 = context.getBean(Student.class);*/
        /*Student student2 = context.getBean("student",Student.class);*/
        student.study();
    }
}
